/*
 * @Author: lixiaowei
 * @Date: 2021-04-10 16:40:35
 * @LastEditors: lixiaowei
 * @LastEditTime: 2021-04-10 16:56:33
 * @Description: file content
 * @FilePath: /heima-bli/STL/算法和lambda.cpp
 */
#include <iostream>
#include <algorithm>
#include <numeric>
#include <functional>

using namespace std;

int main()
{

  int ones[] = {1, 2, 3, 4, 5};
  int twos[] = {10, 20, 30, 40, 50};
  int result[5];

  // transform(ones, ones + 5, twos, result, plus<int>());
  // for_each(result, result + 5, [](int a) -> void { cout << a << endl; });

  transform(ones, ones + 5, twos, result, std::plus<int>()); // ����Ԫ��������Ӳ�����
  for_each(result, result + 5, [](int a) {
    cout << a << endl;
  });

  return 0;
}